module.exports = app => {
	const DataTypes = app.Sequelize;
	const Articles = app.model.define('Articles', {
		id: {
			type: DataTypes.INTEGER(11),
			allowNull: false,
			primaryKey: true,
			autoIncrement: true
		},
		members_id: {
			type: DataTypes.INTEGER(11),
			allowNull: true,
			references: {
				model: 'members',
				key: 'id'
			}
		},
		content: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		lat: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		lng: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		shop_id: {
			type: DataTypes.INTEGER(11),
			allowNull: true
		},
		imgs: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		title: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		ratings: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		created_at: {
			type: DataTypes.DATE,
			allowNull: false,
			defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP')
		},
		updated_at: {
			type: DataTypes.DATE,
			allowNull: false,
			defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP')
		}
	}, {
		freezeTableName: true,
		tableName: 'Articles'
	});


	return Articles;
};